<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>道路挖掘信息管理</title>

<%@ include file="/wf/public/meta_wf.jsp"%>

<script src="${ctx}/gzcgwsp/resources/js/prototype.js" type="text/javascript"></script>
<script src="${ctx}/resources/components/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="${ctx}/resources/js/jquery/jquery.js" type="text/javascript"></script>
<script src="${ctx}/resources/js/jquery/jquery.form.js" type="text/javascript"></script>

<link rel="stylesheet" type="text/css" href="${ctx}/gzcgwsp/resources/css/common-ui.css" />

<script>
	  var width=screen.width-300;
	  var height=screen.height-200;
	  var left = parseInt((screen.width - width)/2);
	  var  top  = parseInt((screen.height - height)/2);
// 重置查询
function RecordReset() {
  location.href = '${ctx}/dllszy!listsimpleData.action';
}
// 查询记录
function RecordQuery() {
  document.forms[0].submit();
}
// 新增记录
function RecordAdd() {
      var url="${ctx}/dllszy!toSimpleInput.action?templateCode=csdllszyspqx";
     window.open(url, "", "top="+top+",left="+left+",width="+width+",height="+height+",location=no,scrollbars = no,resizable=no");
    
}
// 修改记录
function RecordEdit(params) {
  var ids=document.getElementsByName("checkedIds");
  var idvals="";
  for(var i=0;i<ids.length;i++){
  	if(ids[i].checked){
  		idvals+=ids[i].value+",";
  	}
  }
  if(idvals==""){
    alert('当前没有记录，你不能执行此项操作！'); return;
  }else{
  	idvals=idvals.substring(0,idvals.length-1);
  	var idlength=idvals.split(",").length;
  	if(idlength>1){
  		alert('请选择单条记录！'); return;
  	}else{
  		 var url = '${ctx}/dllszy!editSimpleInput.action?id=' + idvals; 
		 window.open(url, "", "top="+top+",left="+left+",width="+width+",height="+height+",location=no,scrollbars = no,resizable=no");
  	}
  }
  
  

}
// 删除记录
function RecordDel(params) {

   if (!window.confirm('确定要删除该记录吗？')) return;
  var chxs = document.forms[0].checkedIds;
  var chx_chked = null;
  var chx_counts = 0;
  if (!chxs || !chxs.length) {
    alert('当前没有记录，你不能执行此项操作！'); return;
  }
  var ids="";
  for (var i = 0; i < chxs.length; i++) {
    if (chxs[i].checked) {
     chx_chked = chxs[i]; 
     chx_counts++; 
     ids+=chxs[i].value+",";
     }
  }
  if(ids!=""){
  	ids=ids.substring(0,ids.length-1);
  }
  if (chx_counts == 0) {
    alert('你没有选中任何记录，请选择记录！'); return;
  }
  if (!window.confirm('确定要删除选中的 ' + chx_counts + ' 条记录吗？')) {
    return;
  }
  var url='${ctx}/dllszy!delete.action?ids='+ids;
  	$.ajax({
		url : url,
		type : "post",
		dataType : "html",
		success : function(msg) {
			if(msg=="success"){
				alert('删除成功!');
				document.location.href="${ctx}/dllszy!listsimpleData.action";	
			}else{
				alert('操作失败！');
			}
			
		},
		error:function() {
			alert("操作失败！请刷新重试！");
		}
	});

}

// 选中所有记录
function checkAll(chxEvent) {
  var chxs = document.forms[0].checkedIds;
  if (chxs && !chxs.length) { chxs.checked = chxEvent.checked; return; }
  if (chxs) for (var i = 0; i < chxs.length; i++) {
    chxs[i].checked = chxEvent.checked;
  }
}
// 跳转至第几页
function jumpPage(pageNo){
  if (pageNo) $('pageNo').value = pageNo;
  document.forms[0].submit();
}
</script>
</head>

<body>
<form action="smart-form-csdlwj!listsimpleData.action" method="post">
  <table width="100%" border="0" cellspacing="2" cellpadding="2">
    <tr>
      <td>
        <table width="100%" border="1" cellspacing="2" cellpadding="2" class="tpl_list_blueui">
          <tr>
            <td height="20" bordercolor="#DBE1E5" bgcolor="#D9E8FB">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="50%">&nbsp;&nbsp;查询</td>
                  <td width="50%" align="right">
                    <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#D9E8FB">
                      <tr>
                        <td height="20">&nbsp;</td>
                        <td width="80">
                         
                        </td>
                        <td width="80">
                         
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <table width="100%" border="1" cellspacing="0" cellpadding="2" class="tpl_list_blueui">
    
          <tr>
            <td bordercolor="#DBE1E5" colspan="" height="25" align="right">
              建设单位：
            </td>
             <td colspan="" width="20%" bordercolor="#B3D9D9" style="padding-right:50px;">
              <input name="jsdw" value="${jsdw}" style="width:100%" />
            </td>
            <td bordercolor="#DBE1E5" colspan="2" height="25" width="10%" align="left">
              受理号：
            </td>
            <td colspan="3" bordercolor="#DBE1E5" style="padding-right:50px;">
              <input name="accepNo" value="${accepNo}" size="30" style="width:100%" />
            </td>
            <td height="20" align="left" onmouseover="this.className='tpl_btn_omover'" onmousedown="this.className='tpl_btn_omdown'" onmouseout="this.className='tpl_btn_omout'" onclick="RecordQuery();"><img src="${ctx}/resources/images/icons1616/zoom_to.gif" />&nbsp;查&nbsp;&nbsp;找</td>
             <td height="20" align="left" style="padding-right:50px;" onmouseover="this.className='tpl_btn_omover'" onmousedown="this.className='tpl_btn_omdown'" onmouseout="this.className='tpl_btn_omout'" onclick="RecordReset();"><img src="${ctx}/resources/images/icons1616/refresh.gif" />&nbsp;重&nbsp;&nbsp;置</td>
             
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>
       <table width="100%" border="1" cellspacing="2" cellpadding="2" class="tpl_list_blueui">
          <tr>
            <td height="20" bordercolor="#DBE1E5" bgcolor="#D9E8FB">
              <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="50%">&nbsp;&nbsp;信息列表</td>
                  <td width="50%" align="right">
                    <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#D9E8FB">
						          <tr>
						            <td height="20">&nbsp;</td>
                        <td width="80">
	                        <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#D9E8FB" onmouseover="this.className='tpl_btn_omover'" onmousedown="this.className='tpl_btn_omdown'" onmouseout="this.className='tpl_btn_omout'" onclick="RecordAdd();">
			                      <tr>
			                        <td height="20" align="center"><img src="${ctx}/resources/images/icons1616/Add.gif" />&nbsp;新&nbsp;&nbsp;增</td>
			                      </tr>
			                    </table>
                        </td>
                        <td width="80">
                          <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#D9E8FB" onmouseover="this.className='tpl_btn_omover'" onmousedown="this.className='tpl_btn_omdown'" onmouseout="this.className='tpl_btn_omout'" onclick="RecordEdit();">
                            <tr>
                              <td height="20" align="center"><img src="${ctx}/resources/images/icons1616/Edit.gif" />&nbsp;修&nbsp;&nbsp;改</td>
                            </tr>
                          </table>
                        </td>
                        <td width="80">
                          <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#D9E8FB" onmouseover="this.className='tpl_btn_omover'" onmousedown="this.className='tpl_btn_omdown'" onmouseout="this.className='tpl_btn_omout'" onclick="RecordDel();">
                            <tr>
                              <td height="20" align="center"><img src="${ctx}/resources/images/icons1616/Delete.gif" />&nbsp;删&nbsp;&nbsp;除</td>
                            </tr>
                          </table>
                        </td>
                
						          </tr>
						        </table>
                  </td>
                </tr>
            </table></td>
          </tr>
      </table></td>
    </tr>
    <tr>
      <td><table width="100%" border="1" cellspacing="2" cellpadding="2" class="tpl_list_blueui">
        <tr>
          <td width="2%" height="20" align="center" bordercolor="#DBE1E5" bgcolor="#E7EEF8">
            <input type="checkbox" id="checkall" title="全选" onclick="checkAll(this)" />
          </td>
          <td width="15%" align="center" bordercolor="#DBE1E5" bgcolor="#E7EEF8">受理号</td>
          <td width="10%" align="center" bordercolor="#DBE1E5" bgcolor="#E7EEF8">受理日期</td>
          <td width="20%" align="center" bordercolor="#DBE1E5" bgcolor="#E7EEF8">申请单位</td>
         <td width="10%" align="center" bordercolor="#DBE1E5" bgcolor="#E7EEF8">申请单位电话</td>
          <td width="20%" align="center" bordercolor="#DBE1E5" bgcolor="#E7EEF8">占用单位</td>
          <td width="10%" align="center" bordercolor="#DBE1E5" bgcolor="#E7EEF8">占用单位联系人</td>
          <td width="10%" align="center" bordercolor="#DBE1E5" bgcolor="#E7EEF8">占用单位电话</td>

        </tr>
        <c:if test="${fn:length(page.result) eq 0}">
        <tr>
          <td colspan="10" height="25" align="center" bordercolor="#DBE1E5" bgcolor="#FFFFD7">
            <img src="${ctx}/resources/images/icons1616/icon_ganth7.gif" />
            &nbsp;当前没有任何记录
          </td>
        </tr>
        </c:if>
        <c:forEach var="form" items="${page.result}" varStatus="stat">
          <tr style="${(stat.index % 2) ne 0 ? 'background-color: #FFFFD7;' : ''}">
            <td bordercolor="#DBE1E5" height="20" align="center">
              <input type="checkbox" name="checkedIds" value="${form.id}" />
            </td>
            <td height="20" align="center" bordercolor="#DBE1E5">${form.acceptNo}</td>
            <td align="center" bordercolor="#DBE1E5"><fmt:formatDate value="${form.tbrq}" pattern="yyyy年MM月dd日" />
            </td>
            <td align="center" bordercolor="#DBE1E5">${form.sqdw}</td>
            <td align="center" bordercolor="#DBE1E5">${form.lxr}</td>
            <td align="center" bordercolor="#DBE1E5">${form.zydw}</td>
            <td align="center" bordercolor="#DBE1E5">${form.zydwLxr}</td>
            <td align="center" bordercolor="#DBE1E5">${form.zydwTel}</td>
       
          </tr>
        </c:forEach>
      </table>
     </td>
    </tr>
    <tr>
      <td>
       <table width="100%" border="1" cellspacing="2" cellpadding="2" class="tpl_list_blueui">
          <tr>
            <td height="20" bordercolor="#DBE1E5">
  			<%@ include file="/gzcgwsp/ywcmn/pager.jsp"%>
            </td>
          </tr>
      </table></td>
    </tr>
  </table>

</form>
</body>
</html>
